import request from '@/utils/request'
// 司法社矫组织机构表 API接口
const di_rel_dept_correctApi = {
  getQueryTree: '/getQueryTree',
  queryPageDeptAndUser: '/queryPageDaptAndUser',
  queryBaseOrgUser: '/queryBaseOrgUser', // 查询司法所的人员数据
  queryBaseOrgTree: '/queryBaseOrgTree', // 查询司法所的组织机构
  queryUserByMobile: '/queryUserByMobile', //根据手机查询用户
  updataContactuser: '/updataContactuser', //修改联系人信息
  getDeptAndUser: '/queryDeptAndUserById', //根据部组织id查询用户信息
  queryBaseOrgUserByUser:"/queryBaseOrgUserByUser" //通过user参数查询司法所人员
}

/**
 * 获取司法组织树结构数据
 */
export function getQueryTree () {
  return request({
    url: di_rel_dept_correctApi.getQueryTree,
    method: 'get'
  })
}

/**
 * 分页查询部门详情列表
 */
export function queryPageDeptAndUser (body) {
  return request({
    url: di_rel_dept_correctApi.queryPageDeptAndUser,
    method: 'post',
    data: body
  })
}

/**
 *通过id查询部门详情
 */
export function getDeptAndUser (id) {
  return request({
    url: di_rel_dept_correctApi.getDeptAndUser,
    method: 'get',
    params: { id }
  })
}

/**
 * 根据部门id和手机查询
 */
export function queryUserByMobile (mobile) {
  return request({
    url: di_rel_dept_correctApi.queryUserByMobile,
    method: 'get',
    params: { mobile }
  })
}

export function updataContactuser (body) {
  return request({
    url: di_rel_dept_correctApi.updataContactuser,
    method: 'post',
    data: body
  })
}

/**
 * 查询司法所的人员数据
 * @param
 * @returns
 */
export function queryBaseOrgUser () {
  return request({
    url: di_rel_dept_correctApi.queryBaseOrgUser,
    method: 'post'
  })
}

/**
 * 查询司法所的人员数据
 * @param
 * @returns
 */
export function queryBaseOrgTree () {
  return request({
    url: di_rel_dept_correctApi.queryBaseOrgTree,
    method: 'post'
  })
}

export function queryBaseOrgUserByUser (body) {
  return request({
    url: di_rel_dept_correctApi.queryBaseOrgUserByUser,
    method: 'post',
    data: body
  })
}